package cn.cnsuh.剑指offer.q15_二进制中1的个数;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String bin = sc.nextLine();
        System.out.println("n = " + bin);
        System.out.println("n = " + Integer.parseInt(bin,2));
        int n = Integer.parseInt(bin,2);


        int ans = 0;
        while (n != 0) {
            ans += n & 1;
            n >>>= 1;
        }
        System.out.println(ans);
    }
}
